package org.asiainfo.common.mybatis.stream.decipher;

import com.mybatisflex.core.datasource.DataSourceDecipher;
import com.mybatisflex.core.datasource.DataSourceProperty;

/**
 * 数据源解密
 *
 * @author dotor-ww
 */
public class Decipher implements DataSourceDecipher {

    /**
     * 解密
     * 可自行进行解密
     *
     * @param property 配置
     * @param value    值
     * @return 解密结果
     */
    @Override
    public String decrypt(DataSourceProperty property, String value) {
        String result = "";
        switch (property) {
            case URL -> result = value;
            case USERNAME -> result = value;
            case PASSWORD -> result = value;
        }
        return result;
    }
}
